﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsClass.aspx.cs" Inherits="NewsClass" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="Css/Css.css" rel="stylesheet" type="text/css" />
</head>
<body>
     <form runat="server" id="NewsAddPage">
     <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
         <tr>
             <td colspan="2" align="center" class="title">
                 <strong>文 章 栏 目 管 理</strong>
             </td>
         </tr>
         <tr class="tdbg">
             <td width="70" height="30">
                 <strong>管理导航：</strong>
             </td>
             <td height="30">
                 <a href="NewsClass.aspx">文章栏目管理首页</a>&nbsp;|&nbsp;<a href="NewsClass.aspx?Action=Add">添加文章栏目</a>&nbsp;|&nbsp;<a href="NewsClass.aspx?Action=NOrder">文章栏目排序</a>
             </td>
         </tr>
     </table>
    <asp:Panel ID="Pl_Add" runat="server" Visible="false">
        <table cellpadding="0" cellspacing="1" border="0" width="100%" align="center">
            <tr>
                <td valign="top">
                    <table width="100%" height="109" border="0" cellpadding="0"  cellspacing="0">
                        <tr>
                            <td valign="top">
                                <table width="100%" border="0" cellpadding="0" class="border" cellspacing="1">
                                    <tr>
                                        <td colspan="2" align="center" class="title">
                                            <strong>添 加 文 章 栏 目</strong>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="25" align="right" class="tdbg">
                                            <strong>所属栏目：</strong>
                                        </td>
                                        <td align="left" class="tdbg">
                                            <asp:DropDownList ID="Drop_ParentID" runat="server">
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" class="tdbg" style="height: 25px">
                                            <strong>栏目名称：</strong>
                                        </td>
                                        <td align="left" class="tdbg" style="height: 25px">
                                            <asp:TextBox ID="ClassName" runat="server" Width="174px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ClassName"
                                                Display="Dynamic" ErrorMessage="*请输入栏目名称"></asp:RequiredFieldValidator>
                                        </td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td height="25" align="right">
                                            <strong>栏目说明：</strong>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="Readme" runat="server" Height="96px" TextMode="MultiLine" Width="306px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td height="25" align="right" >
                                            <strong>栏目图片地址：</strong>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="ClassPicUrl" runat="server" Width="301px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td height="25" align="right" >
                                            <strong>栏目链接地址：</strong>
                                        </td>
                                        <td align="left">
                                            <asp:TextBox ID="LinkUrl" runat="server" Width="298px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr class="tdbg">
                                        <td height="25" align="center" colspan="2">
                                            <asp:Button Style="cursor: hand; background-color: #cccccc;" ID="Button1" runat="server" Text="添加栏目" OnClick="Button1_Click" />&nbsp;<input type="button" style="cursor: hand; background-color: #cccccc;" value="取  消" onclick="javascript:location.href='Newsclass.aspx'" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Pl_Manager" runat="server" Visible=false>
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
            <tr>
                <td colspan="2" align="center" class="title">
                    <strong>文 章 栏 目 管 理</strong>
                </td>
            </tr>
            <tr class="tdbg">
                <td align="center" style="height: 25px">
                    栏目名称
                </td>
                <td align="center">
                    操作权限
                </td>
            </tr>
            <asp:Repeater ID="Rp_ClassList" runat="server" OnItemCommand="Rp_ClassList_ItemCommand"
                OnItemDataBound="Rp_ClassList_ItemDataBound">
                <ItemTemplate>
                    <tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;">
                        <td height="25" width="60%" align="left">
                            <%#ArticleClass.ArticleClassName(ArticleClass.GetModel(Convert.ToInt32(Eval("Classid"))), new bool[Convert.ToInt32(Eval("depth"))+1])%>
                        </td>
                        <td align="right" width="40%">
                            &nbsp;<a href="Newsclass.aspx?Action=Add&ParentID=<%#Eval("classid") %>">添加子栏目</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
                                href="Newsclass.aspx?Action=Modify&ClassID=<%#Eval("classid") %>">修改设置</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a
                                    href="Newsclass.aspx?Action=Move&ClassID=<%#Eval("classid") %>">移动栏目</a>&nbsp;&nbsp;|&nbsp;&nbsp;<asp:LinkButton
                                        CommandArgument='<%#Eval("Classid") %>' CommandName="clearClass" ID="linkbtnClear"
                                        OnClientClick="javascript:return confirm('清空栏目将把栏目(包含子栏目)的所有文章放入回收站中！确定要清空此栏目吗?')"
                                        runat="server">清空</asp:LinkButton>&nbsp;&nbsp;|&nbsp;&nbsp;<asp:LinkButton ID="linkbtnDel"
                                            CommandArgument='<%#Eval("Classid") %>' CommandName="delClass" OnClientClick="javascript:return confirm('删除栏目将同时删除此栏目中的所有文章，并且不能恢复！确定要删除此栏目吗？')"
                                            runat="server">删除</asp:LinkButton>&nbsp;&nbsp;
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <asp:Panel ID="pl_no" runat="server" Visible="false">
                        <tr class="tdbg">
                            <td colspan="3"><br />
                                <center>暂无分类信息</center><br />
                            </td>
                        </tr>
                    </asp:Panel>
                </FooterTemplate>
            </asp:Repeater>
                                
        </table>
    </asp:Panel>
    <asp:Panel ID="Pl_Modify" runat="server" Visible="false">
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
            <tr>
                <td colspan="2" align="center" class="title">
                    <strong>修 改 文 章 栏 目</strong>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="right">
                    <strong style="color: #555555">所属栏目：</strong>
                </td>
                <td align="left">
                    <%=ArticleClass.IncludeClass(ClsId)%>
                </td>
            </tr>
            <tr class="tdbg">
                <td align="right" style="height: 25px">
                    <strong style="color: #555555">栏目名称：</strong>
                </td>
                <td align="left" style="height: 25px">
                    <asp:TextBox ID="Txt_ModifyName" runat="server" Width="174px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Txt_ModifyName"
                        Display="Dynamic" ErrorMessage="*请输入栏目名称"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="right">
                    <strong style="color: #555555">栏目说明：</strong>
                </td>
                <td align="left">
                    <asp:TextBox ID="Txt_ModifyReadme" runat="server" Height="96px" TextMode="MultiLine"
                        Width="306px"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="right">
                    <strong style="color: #555555">栏目图片地址：</strong>
                </td>
                <td align="left">
                    <asp:TextBox ID="Txt_ModifypicUrl" runat="server" Width="301px"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="right">
                    <strong style="color: #555555">栏目链接地址：</strong>
                </td>
                <td align="left">
                    <asp:TextBox ID="Txt_ModifyLinkUrl" runat="server" Width="298px"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="center" colspan="2">
                    <asp:HiddenField ID="Hid" runat="server" />
                    <asp:Button Style="cursor: hand; background-color: #cccccc;" ID="Button2" runat="server" Text="修改栏目设置" OnClick="Button2_Click" />&nbsp;<input type="button" style="cursor: hand; background-color: #cccccc;" value="取  消" onclick="javascript:location.href='Newsclass.aspx'" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Pl_Move" runat="server" Visible="false">
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
            <tr>
                <td colspan="2" align="center" class="title">
                    <strong>移 动 文 章 栏 目</strong>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="left">
                    <strong style="color: #555555">栏目名称：</strong>
                </td>
                <td align="left">
                    <asp:Label ID="lb_MoveClassName" runat="server"></asp:Label>
                </td>
            </tr>
            <tr class="tdbg">
                <td align="left" style="height: 25px">
                    <strong style="color: #555555">当前所属栏目：</strong>
                </td>
                <td align="left" style="height: 25px">
                    <%=ArticleClass.IncludeClass(ClsId)%>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="left">
                    <strong style="color: #555555">移动到：</strong><br />
                    不能指定为当前栏目的下属子栏目
                    <br />
                    不能指定为外部栏目
                </td>
                <td align="left">
                    <asp:ListBox ID="list_Class" runat="server" Height="223px" Width="463px"></asp:ListBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td height="25" align="center" colspan="2">
                    <asp:HiddenField ID="Move_ClsID" runat="server" />
                    <asp:Button ID="Button3" Style="cursor: hand; background-color: #cccccc;" runat="server" Text="保存移动结果" OnClick="Button3_Click" />&nbsp;<input type="button" value="取  消" style="cursor: hand; background-color: #cccccc;" onclick="javascript:location.href='Newsclass.aspx'" />
                </td>
            </tr>              
        </table>
    </asp:Panel>
    <asp:Panel ID="pl_OneOrder" runat="server" Visible="false">
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
            <tr>
                <td colspan="2" align="center" class="title">
                    <strong>一 级 栏 目 排 序</strong>
                </td>
            </tr>
            <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="Repeater1_ItemDataBound"   >
                <ItemTemplate>
                    <tr class="tdbg">
                        <td align="left" style="height: 25px">
                             <asp:HiddenField ID="ClassID" runat="server" Value='<%#Eval("ClassID") %>' />
                                 <asp:HiddenField ID="cRootID" runat="server" Value='<%#Eval("RootID") %>' />
                            
                            &nbsp;<%#Eval("ClassName") %>
                        </td>
                        <td align="left" style="height: 25px; width:120px; text-align:center;">&nbsp;&nbsp;
                            <asp:DropDownList ID="Drop_up" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropUp_SelectedIndexChanged">
                                <asp:ListItem value="0">↑向上移动</asp:ListItem>
                            </asp:DropDownList> </td>
                            <td align="left" bgcolor="#ECF8FF" style="height: 25px">
                            
                            &nbsp;&nbsp;
                            
                           
                            <asp:DropDownList ID="Drop_Down" runat="server" AutoPostBack="true">
                                <asp:ListItem value="0">↓向下移动</asp:ListItem>
                            </asp:DropDownList>                                                    
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                     <asp:Panel ID="pl_NoOrder" runat="server" Visible="false">
                        <tr class="tdbg">
                            <td colspan="4"><br />
                                <center>暂无分类信息</center><br />
                            </td>
                        </tr>
                    </asp:Panel>
                    
                </FooterTemplate>
            </asp:Repeater>          
        </table>
    </asp:Panel>
    <asp:Panel ID="pl_NOrder" runat=server Visible =false>
        <table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align="center">
            <tr>
                <td align="center" class="title">
                    <strong>文 章 栏 目 排 序</strong>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <table width="100%" border="0" cellpadding="0" cellspacing="1" class="border">
                        <asp:Repeater ID="Repeater2" runat="server" OnItemDataBound="Repeater2_ItemDataBound"   >
                            <HeaderTemplate>
                                   <tr style="height: 25px" class="tdbg">
                                        <td align="left"  width="75%">栏目名称</td>
                                        <td align="left"  width="10%">栏目顺序</td>
                                        <td align="center" width="15%">操作</td>
                                   </tr>
                           </HeaderTemplate>
                            <ItemTemplate>
                                <tr class="tdbg" class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#cccccc'" style="padding: 0px 2px;">
                                    <td align="left"style="height: 25px">
                                        &nbsp;<asp:Label ID="lbl_ClassName_Img" runat="server" Text=''></asp:Label><%#Eval("ClassName") %>
                                    </td>
                                    <td align="left" style="height: 25px;  text-align:center;">&nbsp;&nbsp;
                                        <asp:TextBox ID="txt_order_ID" runat="server" Width=80px Text='<%# Eval("OrderID") %>'></asp:TextBox>                                                  
                                    </td>
                                    <td align="left" style="height: 25px">
                                             <asp:HiddenField ID="_ClassID" runat="server" Value='<%#Eval("ClassID") %>' />
                                             <asp:HiddenField ID="_className" runat="server" Value='<%#Eval("className") %>' />
                                             <asp:HiddenField ID="_parentId" runat="server" Value='<%#Eval("parentId") %>' />
                                             <asp:HiddenField ID="_ParentPath" runat="server" Value='<%#Eval("ParentPath") %>' />
                                             <asp:HiddenField ID="_Depth" runat="server" Value='<%#Eval("Depth") %>' />
                                             <asp:HiddenField ID="_RootID" runat="server" Value='<%#Eval("RootID") %>' />
                                             <asp:HiddenField ID="_Child" runat="server" Value='<%#Eval("Child") %>' />
                                             <asp:HiddenField ID="_PrevID" runat="server" Value='<%#Eval("PrevID") %>' />
                                             <asp:HiddenField ID="_NextID" runat="server" Value='<%#Eval("NextID") %>' />
                                        
                                    </td>
                                </tr>
                            </ItemTemplate>

                            <FooterTemplate>
                                 <asp:Panel ID="pl_NoOrder" runat="server" Visible="false">
                                    <tr class="tdbg">
                                        <td colspan="4"><br />
                                            <center>暂无分类信息</center><br />
                                        </td>
                                    </tr>
                                </asp:Panel>
                                
                            </FooterTemplate>
                        </asp:Repeater>
                        <tr class="tdbg" style='text-align: center'>
                            <td colspan="3">
                                <br />
                                <center>
                                    <asp:Button Style="cursor: hand; background-color: #cccccc;" ID="btn_NSave" runat="server" Text="保存排序方式" OnClick="btn_NSave_Click" /></center>
                                <br />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>   
        </table>
    </asp:Panel>
    </form>
</body>
</html>
